<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>结算</title>
	<link rel="stylesheet" href="__PUBLIC__/Mobile/css/bootstrap.css"/>
	<link rel="stylesheet" href="__PUBLIC__/Mobile/css/zhanghou.css">
	<script src="__PUBLIC__/Mobile/js/jquery-1.9.1.js"></script>
	<script src="__PUBLIC__/Mobile/js/97zzw.js"></script>
	<script src="__PUBLIC__/Mobile/js/jquery.flexslider-min.js"></script>
	<script src="__PUBLIC__/Common/LayerMobile/layer.js"></script>
</head>

<body>
<section>
<!--结算-->
<div class="lm">
	<span class="left" style="width:13%;">
		<a href="javascript:history.back(-1);">
			<img src="__PUBLIC__/Mobile/images/cls_left1s.png" style="height:23px; line-height:23px; width:25%;">
		</a> 
	</span>
    <span class="left size20" style="width:72%; padding-right:15%;">商品结算 </span>
</div>
<div class="Clearing">
	<if condition="$find eq ''">
		<div class="Receiving">
	    	<a href="{:U('Goods/address_add')}">新建地址</a>
	    </div>
    <else />
    	<div class="Receiving">
    		<a href="{:U('Goods/choose_address')}">
		    	<p class="size18">收货人：{$find.realname}{$find.mobile}</p>
		        <p class="gray">{$find.prov}{$find.city}{$find.dist}{$find.address}</p>
	        </a>
	    </div>
    </if>
<input type="hidden" name="realname" value="{$find.realname}"/>
<input type="hidden" name="mobile" value="{$find.mobile}" />
<input type="hidden" name="user_address" value="{$find.province}，{$find.city}，{$find.area}，{$find.address}" />
  <div class="manner">
    	<h3>支付方式</h3>
    	<if condition="$weixin['isok'] eq 1">
	  		<a href="javascript:;" class="hvoer" id="1">
		  		<strong>&nbsp;</strong>
		  		<b>
		  			<img style="width:60px; height:60px; margin:5px;" src="__PUBLIC__/Mobile/images/Micro.png">
		  		</b>
		        <span>
			        <p class="size18">微信支付</p>
			        <p class="gray">推荐已在微信中绑定银行卡的用户使用</p>
		        </span>
	        </a>
	   <else />
	   		<!-- <a href="javascript:;" class="hvoer pays" id="1">
		  		<strong>&nbsp;</strong>
		  		<b>
		  			<img src="__PUBLIC__/Mobile/images/Micro.png">
		  		</b>
		        <span>
			        <p class="size18">微信支付</p>
			        <p class="gray">推荐已在微信中绑定银行卡的用户使用</p>
		        </span>
	        </a> -->
	        <a href="javascript:;" class="pays hvoer" id="2">
		        <strong>&nbsp;</strong>
		        <b>
		        	<img src="__PUBLIC__/Mobile/images/Alipay.png">
		        </b>
		        <span>
			        <p class="size18">支付宝</p>
			        <p class="gray">安全快捷，可支持银行卡支付</p>
		        </span>
	        </a>
	   </if>
    </div>
	<form action="{:U('Goods/make_order')}" method="post" onsubmit="return check();">
	  <div class="manner ">
	   	  <h3>订单信息</h3>
	        <ul>

				<input type="hidden" name="address_id" id="address_id" value="{$find.id}">
				<foreach name="goods_data" item="vo">
		            <li>
			            <b>
			            	<img src="{$vo.pic_url}">
							<input type="hidden" name="pic_url[]" value="{$vo.pic_url}">
			            </b>
			            <strong style="width:42%;">{$vo.goods_title}<br/>套餐：{$vo.taocan_name}<br/>送：{$vo.fanli_jifen} 积分</strong>
						<input type="hidden" name="goods_title[]" value="{$vo.goods_title}">
						<input type="hidden" name="goods_id[]" value="{$vo.goods_id}">
						<input type="hidden" name="taocan_name[]" value="{$vo.taocan_name}">
						<input type="hidden" name="fanli_jifen[]" value="{$vo.fanli_jifen}">
						<input type="hidden" name="yunfei" value="{$youfei|default=0}">
			            <span>
				            <p>￥{$vo.price_new}元</p>
							<input type="hidden" name="price_new[]" value="{$vo.price_new}">
				             <p class="gray">×{$vo.goods_num}</p>
							<input type="hidden" name="goods_num[]" value="{$vo.goods_num}">

			            </span>
		            </li>
	           </foreach>
	        </ul>
		  <input type="hidden" name="price_sum" value="{$price_sum}">
	        <p class="Subtotal"><span class="gray">小计：</span><span class="Orange size22">￥{$price_sum|default=0}元</span></p>
	  </div>  
</div>
<div style="height:10px;"></div>
<div class="use">
	<!-- <a href="#" class="cart-select " style="padding:0">&nbsp;</a> -->
	
	<!--积分模块-->
	<!--购物订单-->
	
		<div><span> 使用A积分账户：</span><input name="jfa" id="jfa" value="0" type="number" oninput="jisuan()"><span></span></div>
		
		<div style="height:5px;"></div>
		<div><span> 使用B积分账户：</span><input name="jfb" id="jfb" value="0" type="number" oninput="jisuan()"><span></span></div>
		<div><span style="font-weight:bold;">账户积分余额:</span>&nbsp;&nbsp;<span class="Orange">A账户:{$jfa|default=0}</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="Orange">B账户:{$jfb|default=0}</span></div>
		<div><span> 运费：</span>￥{$youfei|default=0}<span></span></div>		
<div><span style="font-weight:bold;color:red">温馨提示：积分兑换商品至少支付1元人民币</span></div>
	

	</div>
<div class="Navigation-Navigation">
   <span class="Handle size18"><input type="hidden" value="{$price_sum|default=0}" id="price_sum"><b class=" Orange" id="yingfu">应付:￥{$zongjia|default=0}元</b>
   </span>

   		<button class="Pay size18" style="border: none; outline: none; float:right;">支付</button>

</div>
	</form>
</section>
<script>
$(".pays").click(function(){
	$(this).siblings().removeClass("hvoer").end().addClass ("hvoer");
});
function jisuan(){
	yingfu=$("#price_sum").val()-$("#jfa").val()-$("#jfb").val();
	if(yingfu<=0){
		alert("实际支付金额不能为0");
		$("#yingfu").text("应付:￥0元");
	}else{
		$("#yingfu").text("应付:￥"+yingfu+"元");
	}
}
function check(){
	var address_id = $('#address_id').val();
	if(address_id==''){
		alert('您还没有填写地址');
		return false;
	}
	layer.open({type: 2,shadeClose :false});
	return true;
}
</script>
</body>
</html>
